package org.example.controller;

import org.example.entity.Comment;
import org.example.entity.Response;
import org.example.service.CommentService;
import org.example.service.MainService;
import org.example.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/comment")
public class consumerCommentController {

    @Autowired
    private MainService commentService;

    @PostMapping(value = {"/addComment"})
    public Response addcomemt(@RequestBody Comment comment) throws  Exception{
        return this.commentService.addcomemt(comment);
    }
    @PostMapping(value = {"/getComment"})
    public Response getcomemt(Integer postID,Integer page) throws  Exception{
        return this.commentService.getcomemt(postID,page);
    }

    @PostMapping(value = {"/starComment"})
    public Response starcomemt(Integer comID) throws  Exception{
        return this.commentService.starcomemt(comID);
    }
}
